import React, { Component ,Fragment} from 'react'
import './cart.less'

import {connect} from 'react-redux'

const mapState=state=>{
  return {
    list:state.cart.List
  }
}

 class Cart extends Component {
   
  render() {
  console.log(this.props)
    return (
      <Fragment>
      

      {
     this.props.list.map(todo=>{
            return <div className="main" key={todo.id}>
              <img className="main-img"
         src={todo.imgs} />
          <span className="main-mb">{todo.title}</span>
          <span className="main-md">{todo.price}</span>
          <span className="main-sp">-</span>
          <span className="main-sp">{todo.count}</span>
          <span className="main-sp">+</span>
     

            </div>
        })
      }
        
        
      
      </Fragment>
    )
  }
}
export default connect(mapState)(Cart)